<template>
    <view class="bgtmert pd pt100">
        <view class="formrow">
        	<view class="z9 fz28">
        		紧急联系人
        	</view>
        	<view class="mt20 pr">
        		<input type="text" value="" placeholder="请输入紧急联系人姓名" class="jhhgerttyt"  v-model="sos.name"/>
        		<!-- <navigator url="/pages/socialContact/AddressBook" class="cf fz28 dfgdfttwer">
					通讯录 <uni-icons type="right" color="#fff"></uni-icons>
				</navigator> -->
        	</view>
        </view>
		<view class="formrow mt40">
			<view class="z9 fz28">
				手机号
			</view>
			<view class="mt20 pr">
				<input type="number" value="" placeholder="请输入紧急联系人电话" class="jhhgerttyt"  v-model="sos.tel"/>
			</view>
		</view>
    </view>
</template>
<script>
    export default {
        data() {
            return {
				sos:{
					name:'',
					tel:''
				}
			}
        },
        components: {},
		onLoad() {
			let sos=uni.getStorageSync('sos')
			if(sos.hasOwnProperty('name')){
				this.sos.name = sos.name
			}
			if(sos.hasOwnProperty('tel')){
				this.sos.tel = sos.tel
			}
		},
		onNavigationBarButtonTap(e){
			this.savesos()
		},
        methods: {
			savesos(){
				if(!this.sos.tel){
					uni.showToast({
						title:"请输入手机号",
						icon:"none"
					})
					return
				}
				console.log(this.sos);
				 uni.setStorageSync('sos',this.sos)
				 uni.showToast({
				 	title:"设置成功",
					icon:"none"
				 })
				 uni.navigateBack({
				 	delta:1
				 })
			}
		},
        mounted() {}
    }

</script>
<style  scoped>
	.dfgdfttwer{
		position: absolute;
		right: 20upx;
		top: 30upx;
	}
</style>
